#ifndef SOLVER_HPP
#define SOLVER_HPP

#include "Array.hpp"
#include <math.h>
#include <iostream>
#include <iomanip>
#include "Debug.hpp"
#include "Stencil.hpp"
#define PI 3.14159265

class Solver
{
private:

	typedef std::vector<Array> Grids;

public:

	explicit Solver();

	~Solver()
	{
		//	delete P_;
		//	delete _F;
	}
	void Solve(Array &x, const Array &f, size_t cycles, size_t pre, size_t post);

	void setStencil();


private: 

	Grids x_;
	Grids f_;
	Grids r_;
	Stencil A_;
	Stencil I_;
	Stencil J_;
	void smoothGS(Array &x, const Array &f, size_t iter);
	void smoothGSRB(Array &x, const Array &f, size_t iter);void calcResidual (const Array &x, const Array &f, Array &r); 
	void restrict(const Array &r, Array &f);
	void prolongateAndCorrect(const Array &e, Array &x);
};

#endif //SOLVER_HPP

